<HTML><HEAD><TITLE>recorded(+Key, ?Value)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Recorded Database</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>recorded(+Key, ?Value)</H1>
Succeeds if the term Value has been recorded in the indexed database under
the key Key.


<DL>
<DT><EM>Key</EM></DT>
<DD>An atom or a compound term.
</DD>
<DT><EM>Value</EM></DT>
<DD>Any Prolog term.
</DD>
</DL>
<H2>Description</H2>
   Used to find all values associated with a key.  Unifies Value with the
   first term that has been associated with Key.  In the case of compound
   terms, all keys of the same name and arity are treated as equal. If
   Value is instantiated, the instantiated term is used as a filter to reduce 
   the number of terms returned by the recorded database and unified with Value,
   thus improving the speed of retrieving the term.

<P>
   Backtracking will unify Value with successive values associated with Key
   in the order in which they were recorded.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>recorded(+, -) is nondet
<LI>recorded(+, +) is nondet
</UL>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H3>Fail Conditions</H3>
Fails if nothing is recorded under the key Key
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Key is not instantiated.
<DT><EM>(5) type error </EM>
<DD>Key is neither an atom nor a compound term.
</DL>
<H2>Examples</H2>
<PRE>
   Success:
   [eclipse]: record(beer,paulaner),
   &gt;        record(beer,lowenbrau),
   &gt;        record(beer,spaten),
   &gt;        recorded(beer,Value).
   Value = paulaner     More? (;)
   Value = lowenbrau     More? (;)
   Value = spaten     More? (;)
   no (more) solution.
   Fail:
   erase_all(beer),recorded(beer,guiness).
   Error:
   recorded(Beer,Value).                (Error 4)
   recorded("beer",Value).              (Error 5)
   recorded(1,Value).                   (Error 5)



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/record/record-2.html">record / 2</A>
</BODY></HTML>
